Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cip66 fixes #2310

Merged
merged 2 commits into from
Jun 11, 2024
Merged

cip66 fixes #2310

merged 2 commits into from
Jun 11, 2024

Conversation

piersy
Copy link
Contributor

@piersy piersy commented Jun 5, 2024

Description

Fixes two issues with the current cip66 implementation, firstly FeeCurrency was in the wrong position in the struct and secondly the copy method was not copying MaxFeeInFeeCurrency

Tested

Manually: Serialized a transaction and inspected it with rlpdump

0x7af8ce82a4ec01843b9aca00850342770c0083030d409443d72ff17701b2da814620735c39c620ce0ea4a180b844a9059cbb000000000000000000000000bd8be21f6883569ad7d15cc55c87137fcef308c300000000000000000000000000000000000000000000000001605eba271024d6c094765de816845861e75a25fca122bb6898b8b1282a8501a13b860080a02a015905a494549d8a1da26ce769309963e43f407936bbce1ea8276072b08416a072fd12d24c44bc79648bd88f4d8c158f2f0778694557868b3dc7d80e3aa6b539

@piersy piersy requested a review from carterqw2 June 5, 2024 11:12
Copy link

github-actions bot commented Jun 5, 2024

Coverage from tests in ./e2e_test/... for ./consensus/istanbul/... at commit 6319769

coverage: 49.1% of statements across all listed packages
coverage:  63.2% of statements in consensus/istanbul
coverage:  41.4% of statements in consensus/istanbul/announce
coverage:  54.6% of statements in consensus/istanbul/backend
coverage:   0.0% of statements in consensus/istanbul/backend/backendtest
coverage:  24.3% of statements in consensus/istanbul/backend/internal/replica
coverage:  61.2% of statements in consensus/istanbul/core
coverage:  45.0% of statements in consensus/istanbul/db
coverage:   0.0% of statements in consensus/istanbul/proxy
coverage:  64.2% of statements in consensus/istanbul/uptime
coverage:  51.8% of statements in consensus/istanbul/validator
coverage:  79.2% of statements in consensus/istanbul/validator/random

Copy link

github-actions bot commented Jun 5, 2024

5878 passed, 8 failed, 45 skipped

Test failures:
  TestGethClient: gethclient

Failed
  TestGethClient/TestGetProof: gethclient
Failed
  TestGethClient/TestGCStats: gethclient
Failed
  TestGethClient/TestMemStats: gethclient
Failed
  TestGethClient/TestGetNodeInfo: gethclient
Failed
  TestGethClient/TestSetHead: gethclient
Failed
  TestGethClient/TestSubscribePendingTxHashes: gethclient
Failed
  TestGethClient/TestSubscribePendingTxs: gethclient
Failed
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:2036 +0x8e
/opt/hostedtoolcache/go/1.19.13/x64/src/time/sleep.go:176 +0x32
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1412 +0x4a5
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1452 +0x144
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1844 +0x456
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1726 +0x5d9
_testmain.go:95 +0x255
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:63 +0x3b
/runner/_work/celo-blockchain/celo-blockchain/core/tx_cacher.go:55 +0x75
/home/runner/go/pkg/mod/github.com/rjeczalik/[email protected]/tree_nonrecursive.go:36 +0x45
/home/runner/go/pkg/mod/github.com/rjeczalik/[email protected]/tree_nonrecursive.go:29 +0x16a
/home/runner/go/pkg/mod/github.com/rjeczalik/[email protected]/tree_nonrecursive.go:81 +0x5a
/home/runner/go/pkg/mod/github.com/rjeczalik/[email protected]/tree_nonrecursive.go:30 +0x1be
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db_compaction.go:836 +0x6d7
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db.go:155 +0x59b
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0xa8
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db.go:149 +0x52a
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0x158
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db.go:148 +0x4ea
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1494 +0x37a
/runner/_work/celo-blockchain/celo-blockchain/ethclient/gethclient/gethclient_test.go:135 +0x405
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1446 +0x10b
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1493 +0x35f
/runner/_work/celo-blockchain/celo-blockchain/accounts/manager.go:136 +0x14d
/runner/_work/celo-blockchain/celo-blockchain/accounts/manager.go:96 +0x2b5
/runner/_work/celo-blockchain/celo-blockchain/core/chain_indexer.go:314 +0xc7
/runner/_work/celo-blockchain/celo-blockchain/core/chain_indexer.go:122 +0x32f
/runner/_work/celo-blockchain/celo-blockchain/core/blockchain.go:2359 +0x105
/runner/_work/celo-blockchain/celo-blockchain/core/blockchain.go:389 +0x1c8d
/runner/_work/celo-blockchain/celo-blockchain/core/blockchain.go:2438 +0x233
/runner/_work/celo-blockchain/celo-blockchain/core/blockchain.go:396 +0x1d07
/runner/_work/celo-blockchain/celo-blockchain/core/chain_indexer.go:214 +0x1f1
/runner/_work/celo-blockchain/celo-blockchain/core/chain_indexer.go:155 +0x10a
/runner/_work/celo-blockchain/celo-blockchain/core/tx_pool.go:1225 +0x2f4
/runner/_work/celo-blockchain/celo-blockchain/core/tx_pool.go:355 +0x6be
/runner/_work/celo-blockchain/celo-blockchain/core/tx_pool.go:399 +0x2d7
/runner/_work/celo-blockchain/celo-blockchain/core/tx_pool.go:372 +0x985
/runner/_work/celo-blockchain/celo-blockchain/eth/downloader/statesync.go:83 +0x91
/runner/_work/celo-blockchain/celo-blockchain/eth/downloader/downloader.go:270 +0x7f6
/runner/_work/celo-blockchain/celo-blockchain/miner/worker.go:422 +0x310
/runner/_work/celo-blockchain/celo-blockchain/miner/worker.go:136 +0x5d
/runner/_work/celo-blockchain/celo-blockchain/miner/worker.go:134 +0x3bb
/runner/_work/celo-blockchain/celo-blockchain/miner/miner.go:135 +0x1c5
/runner/_work/celo-blockchain/celo-blockchain/miner/miner.go:77 +0x26b
/runner/_work/celo-blockchain/celo-blockchain/eth/downloader/api.go:63 +0x1f3
/runner/_work/celo-blockchain/celo-blockchain/eth/downloader/api.go:49 +0x105
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/filter_system.go:455 +0x40c
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/filter_system.go:138 +0x3a5
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/api.go:82 +0x9b
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/api.go:70 +0x149
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x59b
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2e5
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x113
/home/runner/go/pkg/mod/github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5d8
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/table.go:251 +0x2fc
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/v4_udp.go:153 +0x3d6
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/v4_udp.go:453 +0x2e5
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/v4_udp.go:156 +0x42a
/opt/hostedtoolcache/go/1.19.13/x64/src/runtime/netpoll.go:305 +0x89
/opt/hostedtoolcache/go/1.19.13/x64/src/internal/poll/fd_poll_runtime.go:84 +0x32
/opt/hostedtoolcache/go/1.19.13/x64/src/internal/poll/fd_poll_runtime.go:89
/opt/hostedtoolcache/go/1.19.13/x64/src/internal/poll/fd_unix.go:277 +0x1e5
/opt/hostedtoolcache/go/1.19.13/x64/src/net/fd_posix.go:72 +0x29
/opt/hostedtoolcache/go/1.19.13/x64/src/net/udpsock_posix.go:59 +0x85
/opt/hostedtoolcache/go/1.19.13/x64/src/net/udpsock.go:149 +0x31
/opt/hostedtoolcache/go/1.19.13/x64/src/net/udpsock.go:141 +0x50
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/v4_udp.go:531 +0xf4
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/v4_udp.go:157 +0x48d
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/lookup.go:135 +0xaa
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/lookup.go:112 +0xa9
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/lookup.go:69 +0x36
/runner/_work/celo-blockchain/celo-blockchain/p2p/discover/lookup.go:214 +0xaa
/runner/_work/celo-blockchain/celo-blockchain/p2p/enode/iter.go:279 +0xbb
/runner/_work/celo-blockchain/celo-blockchain/p2p/enode/iter.go:180 +0x250
/runner/_work/celo-blockchain/celo-blockchain/p2p/enode/iter.go:241
/runner/_work/celo-blockchain/celo-blockchain/p2p/enode/iter.go:228 +0x230
/runner/_work/celo-blockchain/celo-blockchain/p2p/dial.go:327 +0x9f
/runner/_work/celo-blockchain/celo-blockchain/p2p/dial.go:185 +0x450
/runner/_work/celo-blockchain/celo-blockchain/p2p/dial.go:248 +0x2cf
/runner/_work/celo-blockchain/celo-blockchain/p2p/dial.go:186 +0x4ca
/runner/_work/celo-blockchain/celo-blockchain/p2p/server.go:902 +0x985
/runner/_work/celo-blockchain/celo-blockchain/p2p/server.go:589 +0x57c
/runner/_work/celo-blockchain/celo-blockchain/eth/protocols/eth/discovery.go:48 +0x11d
/runner/_work/celo-blockchain/celo-blockchain/eth/protocols/eth/discovery.go:45 +0xda
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:50 +0xcc
/runner/_work/celo-blockchain/celo-blockchain/eth/bloombits.go:48 +0x34
/runner/_work/celo-blockchain/celo-blockchain/eth/handler.go:587 +0x118
/runner/_work/celo-blockchain/celo-blockchain/eth/handler.go:460 +0xfa
/runner/_work/celo-blockchain/celo-blockchain/eth/handler.go:575 +0x8a
/runner/_work/celo-blockchain/celo-blockchain/eth/handler.go:465 +0x1ad
/runner/_work/celo-blockchain/celo-blockchain/eth/sync.go:128 +0x26e
/runner/_work/celo-blockchain/celo-blockchain/eth/handler.go:469 +0x20a
/runner/_work/celo-blockchain/celo-blockchain/rpc/server.go:87 +0x165
/runner/_work/celo-blockchain/celo-blockchain/rpc/inproc.go:29 +0xc5
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:579 +0x2cc
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:241 +0x3ac
/runner/_work/celo-blockchain/celo-blockchain/eth/fetcher/block_fetcher.go:380 +0x367
/runner/_work/celo-blockchain/celo-blockchain/eth/fetcher/block_fetcher.go:232 +0x56
/runner/_work/celo-blockchain/celo-blockchain/eth/fetcher/tx_fetcher.go:355 +0x165
/runner/_work/celo-blockchain/celo-blockchain/eth/fetcher/tx_fetcher.go:337 +0x56
/runner/_work/celo-blockchain/celo-blockchain/ethclient/gethclient/gethclient_test.go:317 +0x466
/runner/_work/celo-blockchain/celo-blockchain/ethclient/gethclient/gethclient_test.go:127 +0x1d
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1446 +0x10b
/opt/hostedtoolcache/go/1.19.13/x64/src/testing/testing.go:1493 +0x35f
/runner/_work/celo-blockchain/celo-blockchain/miner/worker.go:349 +0x433
/runner/_work/celo-blockchain/celo-blockchain/miner/worker.go:415 +0x35
/runner/_work/celo-blockchain/celo-blockchain/miner/worker.go:414 +0x1ea
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:579 +0x2cc
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:241 +0x3ac
/opt/hostedtoolcache/go/1.19.13/x64/src/net/pipe.go:159 +0x157
/opt/hostedtoolcache/go/1.19.13/x64/src/net/pipe.go:142 +0x25
/opt/hostedtoolcache/go/1.19.13/x64/src/encoding/json/stream.go:165 +0x188
/opt/hostedtoolcache/go/1.19.13/x64/src/encoding/json/stream.go:140 +0xbb
/opt/hostedtoolcache/go/1.19.13/x64/src/encoding/json/stream.go:63 +0x78
/runner/_work/celo-blockchain/celo-blockchain/rpc/json.go:209 +0x4d
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:652 +0xb7
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:576 +0x155
/opt/hostedtoolcache/go/1.19.13/x64/src/net/pipe.go:159 +0x157
/opt/hostedtoolcache/go/1.19.13/x64/src/net/pipe.go:142 +0x25
/opt/hostedtoolcache/go/1.19.13/x64/src/encoding/json/stream.go:165 +0x188
/opt/hostedtoolcache/go/1.19.13/x64/src/encoding/json/stream.go:140 +0xbb
/opt/hostedtoolcache/go/1.19.13/x64/src/encoding/json/stream.go:63 +0x78
/runner/_work/celo-blockchain/celo-blockchain/rpc/json.go:209 +0x4d
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:652 +0xb7
/runner/_work/celo-blockchain/celo-blockchain/rpc/client.go:576 +0x155
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/api.go:160 +0x15f
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/api.go:154 +0xec
/opt/hostedtoolcache/go/1.19.13/x64/src/runtime/select.go:590 +0x23e
/opt/hostedtoolcache/go/1.19.13/x64/src/reflect/value.go:2952 +0xd2
/runner/_work/celo-blockchain/celo-blockchain/rpc/subscription.go:335 +0x2e5
/runner/_work/celo-blockchain/celo-blockchain/rpc/subscription.go:294 +0x66
/runner/_work/celo-blockchain/celo-blockchain/rpc/handler.go:283 +0x1f9
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/api.go:160 +0x15f
/runner/_work/celo-blockchain/celo-blockchain/eth/filters/api.go:154 +0xec
/opt/hostedtoolcache/go/1.19.13/x64/src/runtime/select.go:590 +0x23e
/opt/hostedtoolcache/go/1.19.13/x64/src/reflect/value.go:2952 +0xd2
/runner/_work/celo-blockchain/celo-blockchain/rpc/subscription.go:331 +0x2fe
/runner/_work/celo-blockchain/celo-blockchain/rpc/subscription.go:294 +0x66
/runner/_work/celo-blockchain/celo-blockchain/rpc/handler.go:283 +0x1f9
This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.

Copy link
Contributor

@carterqw2 carterqw2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@piersy piersy merged commit 6319769 into master Jun 11, 2024
27 checks passed
@piersy piersy deleted the piersy/cip66-fixes branch June 11, 2024 10:08
chuwt added a commit to chuwt/celo-blockchain that referenced this pull request Jun 28, 2024
* cip66 fixes (celo-org#2310)

* Fix rlp serailisation of cip66 tx to match cip definition

https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0066.md

* Ensure cip66 tx MaxFeeInFeeCurrency is copied

The field was not being copied by the copy method.

* new tracer

* fix new tracer

* fix depth

* fix top contracts

---------

Co-authored-by: piersy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants